package main

import (
	"iot-base/common/dbconn"

	"time"
)

type SB struct {
	Id       string `gorm:"primarykey"`
	Sbbh     string `gorm:"uniqueIndex:sbbh"`
	Sbdz     string `gorm:"not null"` //设备状态
	Kzsbmc   string `gorm:"not null"`
	Sbzx     byte   `gorm:"not null"` //设备在线
	Sbzt     byte   `gorm:"not null"` //设备状态
	Sdzt     byte   `gorm:"not null"` //市电状态
	Mzt      byte   `gorm:"not null"`
	Sbjs     byte   `gorm:"not null"`
	Gmzt     byte   `gorm:"not null"` //光猫状态 ，只要断线则为1
	Kzsbgdzt byte   `gorm:"not null"`
	Dy       string
	Txzl     string
	Zhgxsj   time.Time `gorm:"not null"`
	By1      string    `gorm:"not null"`
	By2      string    `gorm:"not null"`
	By3      string    `gorm:"not null"`
	By4      string    `gorm:"not null"`
	By5      string    `gorm:"not null"`
}

func (pSB *SB) TableName() string {
	return "sbxxb"
}

func init() {
	//rand.Seed(time.Now().Unix())
	dbconn.DBConnection.AutoMigrate(&SB{})
	//dbconn.DBConnection.AutoMigrate(&ErrLog{})
}
